import { BaseErr } from "utils";

class DropError extends BaseErr {
    errType = "drop";
    constructor() {
        super(-100010, "请求失败,请稍后再试");
    }
}

class EmptyRequest extends BaseErr {
    errType = "empty";
    constructor() {
        super(-100011, "没有设置要发送的请求");
    }
}

// 取消请求
class CancelError extends BaseErr {
    errType = "cancel";
    reason?: string;
    constructor(reason?: string) {
        let errMsg = reason || "请求被取消";
        super(-100012, errMsg);
        this.reason = reason;
    }
}

export { CancelError, EmptyRequest, DropError };
